package com.ssy.lingxi.system.model.response;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 会员注册资料校验规则
 * @author 万宁
 * @version 2.0.0
 * @date 2020-06-01
 */
public class MemberConfigCheckRuleVO implements Serializable {
    private static final long serialVersionUID = 8363905471963327260L;

    public interface Add {}

    public interface Update {}

    public interface Delete {}

    /**
     * 规则id
     */
    @NotNull(message = "id要大于0", groups = {Update.class, Delete.class})
    @Positive(message = "id要大于0", groups = {Update.class, Delete.class})
    private Long id;

    /**
     * 规则名称
     */
    @NotBlank(message = "规则名称不能为空", groups = {Add.class, Update.class})
    @Size(max = 20, message = "规则名称最长20个字符", groups = {Add.class, Update.class})
    private String ruleName;

    /**
     * 规则类型
     */
    @NotBlank(message = "规则类型不能为空", groups = {Add.class, Update.class})
    @Size(max = 20, message = "规则类型最长20个字符", groups = {Add.class, Update.class})
    private String ruleType;

    /**
     * 前端校验字段时使用的正则表达式
     */
    @Size(max = 200, message = "正则表达式最长200个字符", groups = {Add.class, Update.class})
    private String rulePattern;

    /**
     * 提示信息
     */
    @NotBlank(message = "提示语模板不能为空", groups = {Add.class, Update.class})
    @Size(max = 200, message = "提示语模板最长200个字符", groups = {Add.class, Update.class})
    private String msg;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    public String getRuleType() {
        return ruleType;
    }

    public void setRuleType(String ruleType) {
        this.ruleType = ruleType;
    }

    public String getRulePattern() {
        return rulePattern;
    }

    public void setRulePattern(String rulePattern) {
        this.rulePattern = rulePattern;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
